Arduino Programming using MATLAB by Kurniawan Agus

Arduino Programming using MATLAB by Kurniawan Agus

Author:Kurniawan, Agus
Language: eng
Format: epub
Publisher: PE Press
Published: 2015-09-10T16:00:00+00:00


Save this program as led_rgb.m.

This program will generate six colors: red, green, blue, yellow, purple, and aqua.

4.2.3 Testing

Upload and run the program. You should see several color on RGB LED.

>> led_rgb

The following is a sample demo on Command Window on MATLAB.

The following is a sample demo on hardware.

4.3 Demo Analog Output Voltage: LED Brightness

In this demo, we try to control LED brightness by controlling voltage on LED. MATLAB for Arduino support provides writePWMVoltage() function to set voltage on PWM pins. We can set a voltage value from 0 to 5 for Arduino Uno/Mega and 0 - 3.3 for Arduino Due.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.